package jicheng1;

public class Centre {
   private String adress;
   private String number;

    public Centre(String adress, String number) {
        this.adress = adress;
        this.number = number;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }
    public void maintain(Car car){
        System.out.println("欢迎光临"+adress+"维修中心，本公司电话是"+number);
        if (car instanceof DaZhong){
            ((DaZhong) car).start();
            ((DaZhong) car).speed();
            ((DaZhong) car).brake();
            System.out.println("车辆检测正常");

        }else if (car instanceof WuLing){
            ((WuLing) car).start();
            ((WuLing) car).speed();
            ((WuLing) car).brake();
            System.out.println("车辆检测正常");

        }else if (car instanceof BenChi){
            ((BenChi) car).start();
            ((BenChi) car).speed();
            ((BenChi) car).brake();
            System.out.println("车辆检测正常");
        }
    }
}
